<?php

namespace App\Services\Strator;

use App\Models\Strator\StratorDepartment;
use App\Models\Strator\StratorHasPosition;
use App\Models\Strator\StratorPosition;
use Illuminate\Support\Collection;

class StratorPositionService
{
    //
    public function getAuthPositionIds($strator):Collection{
        if($strator->is_super==1){
            return StratorPosition::pluck('id');
        }
        $departmentService = new StratorDepartmentService();
        $department_ids = $departmentService->getAuthDepartmentIds($strator);
        return StratorPosition::whereIn('department_id',$department_ids)->pluck('id');
    }


}
